/**
 *  @file: config.h
 *  @author: nwz
 *  @brief: 
 *  @date: 2024��7��25��
 * 
 */

#ifndef CODE_CONFIG_CONFIG_H_
#define CODE_CONFIG_CONFIG_H_

#define VERSION		1
#define VERSION_SUB	0
#define JUMP_APP_FLASH_ADDR						0x08020000
//#define APP_FLASH_ADDR						0x08100000

#define FLASH_MAP_ADDR							0x08000000
#define BOOTLOADER_FLASH_START					(0)
#define BOOTLOADER_FLASH_SIZE					(120*1024)
#define BOOTLOADER_PARAM_SIZE					(8*1024)
#define APP_FLASH_START							(BOOTLOADER_FLASH_SIZE+BOOTLOADER_PARAM_SIZE)
#define APP_FLASH_SIZE							(1024*1024 -APP_FLASH_START)
#define DOWNLOAD_FLASH_START					(1024*1024)
#define DOWNLOAD_FLASH_SIZE						(1024*1024)


#define MIN_DMA_TRANSFER_SIZE					100

#define CONSOLE_BAUD_RATE						500000
#define CONSOLE_RECV_TIMEOUT					100
#define CONSOLE_DMA_READ_BUFFER_SIZE			(1024*2)
#define CONSOLE_LOG_BUFFER_SIZE					(512)
#define CONSOLE_WRITE_BUFFER_SIZE				(1024*10)
#define CONSOLE_READ_BUFFER_SIZE				(1024*10)

#define FLASH_STREAM_BUFFER_SIZE				(1024*2)
#define FLASH_STREAM_TEMP_READ_BUFFER_SIZE		512

#define BTN_LONG_CLICK_TIME						3000
#define MIN_STACK_SIZE						256

#define MAIN_TASK_STACK_SIZE					512
#define MAIN_TASK_PRIORITY						2
#define BOOT_APP_TASK_STACK_SIZE					MIN_STACK_SIZE
#define BOOT_APP_TASK_PRIORITY					0
#define TIP_TASK_STACK_SIZE						512
#define TIP_TASK_PRIORITY						1
#define KEY_TASK_STACK_SIZE						MIN_STACK_SIZE
#define KEY_TASK_PRIORITY						2
#define FLASH_DATA_TASK_STACK_SIZE				MIN_STACK_SIZE
#define FLASH_DATA_TASK_PRIORITY					2
#define FLASH_STREAM_TASK_STACK_SIZE				MIN_STACK_SIZE
#define FLASH_STREAM_TASK_PRIORITY				2
#define CONSOLE_WRITE_TASK_STACK_SIZE			MIN_STACK_SIZE
#define CONSOLE_WRITE_TASK_PRIORITY				1
#define CONSOLE_READ_TASK_STACK_SIZE			MIN_STACK_SIZE
#define CONSOLE_READ_TASK_PRIORITY				2
#define DEBUG_TASK_STACK_SIZE					512
#define DEBUG_TASK_PRIORITY						2
#define LED_TASK_STACK_SIZE						MIN_STACK_SIZE
#define LED_TASK_PRIORITY						0

#define DEFAULT_WAIT_TICKS			pdMS_TO_TICKS(5)

#endif /* CODE_CONFIG_CONFIG_H_ */
